package com.example.unitestexample.controller;


import com.example.unitestexample.entity.Employee;
import com.example.unitestexample.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class EmployeeRestController {

    @Autowired
    private EmployeeService employeeService;

    @GetMapping(value = "/employee")
    public List<Employee> getAllEmployee() {
        return employeeService.getAllEmployees();
    }
}
